package com.apexedu.eas.entity;

import com.apexedu.util.StringUtil;
import com.apexedu.util.json.JsonUtil;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;

/**
 * 排课信息明细
 * Created with IntelliJ IDEA.
 * User: ly
 * Date: 13-11-7
 * Time: 下午4:45
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "TJX_PKXX_MX")
@Entity
public class TjxPkxxMx {
	private Long id;
	private String ls; //任课教师
	private Long js; //教室
	private String zc; //周次
	private Integer sfdsz; //是否单双周 1单 2双 0全部
	private String xq1; //星期一上课节次 16进制
	private String xq2; //星期二上课节次 16进制
	private String xq3; //星期三上课节次 16进制
	private String xq4; //星期四上课节次 16进制
	private String xq5; //星期五上课节次 16进制
	private String xq6; //星期六上课节次 16进制
	private String xq7; //星期日上课节次 16进制
	private Long tjxPkxxId; //排课信息表id
    private String bxjs;//备选教师
    private String zcxx;//周次明细

    /** 非表中字段**/


    private Integer type; //1代表选修的，0代表必修
	/**
	 * 教室全称
	 */
	private String jsName;

    private Integer zws; //教室座位数

    /**
	 * 任课教师名
	 */
	private String lsName;
	/**
	 * 课程名称
	 */
	private String kcmc;
    /**
     * 教学班名称
     */
    private String jxbmc;

	/**
	 * 星期节次集合
	 */
	private List<String> xqjc = new ArrayList<String>();

    /**
     * 任课教师集合
     */
    private List<CommonPojo> listLs = new ArrayList<CommonPojo>();


    /**
     * 行政班集合
     */
    private List<CommonPojo> listBj = new ArrayList<CommonPojo>();
    /**
     * 上课节次
     */

    private String skjc;

    /**
     * 班级id
     */

    private String bjid;


    /**
     * 班级名称
     */

    private String bjmc;

	/**考试考查课*/
	private String kskck;
	/**班级人数*/
	private String bjrs;

	/**行政班*/
	private String xzb;

	/**学生id*/
	private String xsid;

	/**备注*/
	private String bz;

	/**操作人员*/
	private String czr;

	public TjxPkxxMx() {
	}

	public TjxPkxxMx(Long id, String ls,Long js, String jsName,Integer zws, String zc, Integer sfdsz, String xq1, String xq2,
					 String xq3, String xq4, String xq5, String xq6, String xq7, Long tjxPkxxId) {
		this.id = id;
		this.ls = ls;
		this.js = js;
		this.jsName = jsName;
		this.zws = zws;
		this.zc = zc;
		this.sfdsz = sfdsz;
		this.xq1 = xq1;
		this.xq2 = xq2;
		this.xq3 = xq3;
		this.xq4 = xq4;
		this.xq5 = xq5;
		this.xq6 = xq6;
		this.xq7 = xq7;
		this.tjxPkxxId = tjxPkxxId;
	}

	public TjxPkxxMx(Long id, String ls,Long js, String jsName,Integer zws, String zc, Integer sfdsz, String xq1, String xq2,
					 String xq3, String xq4, String xq5, String xq6, String xq7, Long tjxPkxxId,String bz) {
		this.id = id;
		this.ls = ls;
		this.js = js;
		this.jsName = jsName;
		this.zws = zws;
		this.zc = zc;
		this.sfdsz = sfdsz;
		this.xq1 = xq1;
		this.xq2 = xq2;
		this.xq3 = xq3;
		this.xq4 = xq4;
		this.xq5 = xq5;
		this.xq6 = xq6;
		this.xq7 = xq7;
		this.tjxPkxxId = tjxPkxxId;
		this.bz=bz;
	}

	@javax.persistence.Column(name = "ID")
	@Id
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@javax.persistence.Column(name = "GXJG0101")
	@Basic
	public String getLs() {
		return ls;
	}

	public void setLs(String ls) {
		this.ls = ls;
	}

	@javax.persistence.Column(name = "JS")
	@Basic
	public Long getJs() {
		return js;
	}

	public void setJs(Long js) {
		this.js = js;
	}



	@javax.persistence.Column(name = "ZC")
	@Basic
	public String getZc() {
		return zc;
	}

	public void setZc(String zc) {
		this.zc = zc;
	}

	@javax.persistence.Column(name = "SFDSZ")
	@Basic
	public Integer getSfdsz() {
		return sfdsz;
	}

	public void setSfdsz(Integer sfdsz) {
		this.sfdsz = sfdsz;
	}

	@javax.persistence.Column(name = "XQ1")
	@Basic
	public String getXq1() {
		return xq1;
	}

	public void setXq1(String xq1) {
		this.xq1 = xq1;
	}

	@javax.persistence.Column(name = "XQ2")
	@Basic
	public String getXq2() {
		return xq2;
	}

	public void setXq2(String xq2) {
		this.xq2 = xq2;
	}

	@javax.persistence.Column(name = "XQ3")
	@Basic
	public String getXq3() {
		return xq3;
	}

	public void setXq3(String xq3) {
		this.xq3 = xq3;
	}

	@javax.persistence.Column(name = "XQ4")
	@Basic
	public String getXq4() {
		return xq4;
	}

	public void setXq4(String xq4) {
		this.xq4 = xq4;
	}

	@javax.persistence.Column(name = "XQ5")
	@Basic
	public String getXq5() {
		return xq5;
	}

	public void setXq5(String xq5) {
		this.xq5 = xq5;
	}

	@javax.persistence.Column(name = "XQ6")
	@Basic
	public String getXq6() {
		return xq6;
	}

	public void setXq6(String xq6) {
		this.xq6 = xq6;
	}

	@javax.persistence.Column(name = "XQ7")
	@Basic
	public String getXq7() {
		return xq7;
	}

	public void setXq7(String xq7) {
		this.xq7 = xq7;
	}

	@javax.persistence.Column(name = "TJX_PKXX_ID")
	@Basic
	public Long getTjxPkxxId() {
		return tjxPkxxId;
	}

	public void setTjxPkxxId(Long tjxPkxxId) {
		this.tjxPkxxId = tjxPkxxId;
	}

    @javax.persistence.Column(name = "BXJS")
    @Basic
    public String getBxjs() {
        return bxjs;
    }

    public void setBxjs(String bxjs) {
        this.bxjs = bxjs;
    }

    @Override
	public String toString() {
		return JsonUtil.getJSONString(this);
	}

    @Transient
    public String getZcxx() {
        return zcxx;
    }

    public void setZcxx(String zcxx) {
        this.zcxx = zcxx;
    }

	@Transient
	public String getJsName() {
		return jsName;
	}

	public void setJsName(String jsName) {
		this.jsName = jsName;
	}



    @Transient
    public Integer getZws() {
        return zws;
    }

    public void setZws(Integer zws) {
        this.zws = zws;
    }

    /**
	 * 获取开始周次
	 *
	 * @return 开始周次
	 */
	@Transient
	public int getKszc() {
		return StringUtil.isNotBlank(zc) ? Integer.parseInt(zc.split("-")[0]) : 1;
	}

	/**
	 * 获取结束周次
	 *
	 * @return 结束周次
	 */
	@Transient
	public int getJszc() {
		return StringUtil.isNotBlank(zc) ? Integer.parseInt(zc.split("-")[1]) : 20;
	}

	@Transient
	public String getLsName() {
		return lsName;
	}

	public void setLsName(String lsName) {
		this.lsName = lsName;
	}

	@Transient
	public String getKcmc() {
		return kcmc;
	}

	public void setKcmc(String kcmc) {
		this.kcmc = kcmc;
	}

    @Transient
    public String getJxbmc() {
        return jxbmc;
    }

    public void setJxbmc(String jxbmc) {
        this.jxbmc = jxbmc;
    }

    @Transient
    public List<CommonPojo> getListLs() {
        return listLs;
    }

    public void setListLs(List<CommonPojo> listLs) {
        this.listLs = listLs;
    }

    @Transient
    public List<CommonPojo> getListBj() {
        return listBj;
    }

    public void setListBj(List<CommonPojo> listBj) {
        this.listBj = listBj;
    }

    /**
	 * 星期节次列表
	 * @return
	 */
	@Transient
	public List<String> getXqjc() {
		if (xqjc.isEmpty()) {
			xqjc.add(xq1);
			xqjc.add(xq2);
			xqjc.add(xq3);
			xqjc.add(xq4);
			xqjc.add(xq5);
			xqjc.add(xq6);
			xqjc.add(xq7);
		}
		return xqjc;
	}

	public void setXqjc(List<String> xqjc) {
		this.xqjc = xqjc;
		this.xq1 = xqjc.get(0);
		this.xq2 = xqjc.get(1);
		this.xq3 = xqjc.get(2);
		this.xq4 = xqjc.get(3);
		this.xq5 = xqjc.get(4);
		if(xqjc.size()>5){
			this.xq6 = xqjc.get(5);
			this.xq7 = xqjc.get(6);
		}
	}

    @Transient
    public Integer getType() {
        return type;
    }

    @Transient
    public void setType(Integer type) {
        this.type = type;
    }

    @Transient
    public String getSkjc() {
        return skjc;
    }

    public void setSkjc(String skjc) {
        this.skjc = skjc;
    }

    @Transient
    public String getBjid() {
        return bjid;
    }

    public void setBjid(String bjid) {
        this.bjid = bjid;
    }

    @Transient
    public String getBjmc() {
        return bjmc;
    }

    public void setBjmc(String bjmc) {
        this.bjmc = bjmc;
    }

	@Transient
	public String getKskck() {
		return kskck;
	}

	public void setKskck(String kskck) {
		this.kskck = kskck;
	}

	@Transient
	public String getBjrs() {
		return bjrs;
	}
	public void setBjrs(String bjrs) {
		this.bjrs = bjrs;
	}

	@Transient
	public String getXzb() {
		return xzb;
	}
	public void setXzb(String xzb) {
		this.xzb = xzb;
	}

	@Transient
	public String getXsid() {
		return xsid;
	}
	public void setXsid(String xsid) {
		this.xsid = xsid;
	}

	@Transient
	public String getBz() {
		return bz;
	}
	public void setBz(String bz) {
		this.bz = bz;
	}
	@Transient
	public String getCzr() {
		return czr;
	}
	public void setCzr(String czr) {
		this.czr = czr;
	}

}
